package br.com.fiap.test;

import javax.swing.*;
import java.awt.*;


/**
 * Created with IntelliJ IDEA.
 * User: gabriel.medina
 * Date: 20/09/12
 * Time: 17:01
 * To change this template use File | Settings | File Templates.
 */
public class TelaEntrada extends JFrame {

    public TelaEntrada(){
        configProprerties();
    }

    private void bntEntrarActionPerformed(java.awt.event.ActionEvent evt) {
        JOptionPane.showMessageDialog( this, "Mensagem de Informação",
                "Action...", JOptionPane.INFORMATION_MESSAGE);
    }


    public void configProprerties(){

        //Components
        Label nm1 = new Label("Alexandre Akel  RM62150");
        Label nm2 = new Label("Gabriel Medina  RM62470");
        Label turma = new Label("Turma: 3-SIR");
        Label prof = new Label("Prof: Evandro Luquini");
        Button bntEntrar = new Button();
        bntEntrar.setLabel("Entrar");

        bntEntrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bntEntrarActionPerformed(evt);
            }
        });

        //Panels
        JPanel jpLabel = new JPanel(new GridLayout(5,1));
        jpLabel.add(nm1);
        jpLabel.add(nm2);
        jpLabel.add(turma);
        jpLabel.add(prof);
        jpLabel.add(bntEntrar);

        //JFrame
        ImageIcon icon = new ImageIcon("src/imagens/fiap.gif");
        this.setIconImage(icon.getImage());
        this.setResizable(false);
        this.setBackground(Color.LIGHT_GRAY);
        this.setTitle("Rede Social - Grafos");
        this.setSize(250,200);
        this.setLocationRelativeTo(null);
        this.setLayout(new BorderLayout());
        this.getContentPane().add(jpLabel, BorderLayout.CENTER);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setVisible(true);

    }
}
